home *** CD-ROM | disk | FTP | other *** search
- /*//////////////////////////////////////////////////////////////////////////
- /// ///
- /// Btrieve Classes ///
- /// ///
- /// Shareware Version 2.02 ///
- /// ___ ///
- /// /_____\ ///
- /// | | Copyright (c) 1991, 1992 ///
- /// | R | ///
- /// ----|_______|---- by ///
- /// /------/ | | \------\ ///
- /// | | | | | | -- Object Resource Corp. -- ///
- /// | O | | | | C | ///
- /// | |/ \| | 4323 Brown Suite 249 ///
- /// ------- ------- Dallas, TX 75219 ///
- /// Object Resource Corp. ///
- /// (214) 528-2745 ///
- /// ///
- /// All Rights Reserved. ///
- /// ///
- //////////////////////////////////////////////////////////////////////////*/
-
- ** NOTICE::RIGHTS OF USERS **
-
- The freely distributed package may be used for evaluation purposes only.
- Inclusion in ANY application for use or for sale requires registration.
-
-
- Also required: TURCBTRV.C ... the Btrieve compiler-specific interface
- or routines provided with either the Btrieve
- MSCXBTRV.C developer's kit or the Btrieve for Windows
- or developer's kit from Novell
- WBTRINTF.C
-
- Btrieve Version 5.0 or greater
-
- Borland C++ Version 3.x
- or
- Microsoft C++ Version 7.00
-
- NOTE: Support for Borland C++ Version 2.0 is available by registration.
-
-
- Files included: BTCLASS.DOC this file
- HISTORY.DOC change history
- BT.h C header
- BTDEF.HPP Class Declarations
- BTDSET.HPP " "
- BTKEY.HPP " "
- BTBUFF.HPP " "
- BTTRAN.HPP " "
- BTMNGER.HPP " "
- BTKDEF.HPP " "
- BTSKDEF.HPP " "
- BTSKEY.HPP " "
- SBTBOR3.LIB SMALL model class library created
- with BORLAND C++ VERSION 3.x
- SBTMS7.LIB SMALL model class library created
- with Microsoft C++ Version 7.00
- EXAMPLE.CPP Example application
- EXAMPLE.PRJ Example project file for BORLAND C++
- You may need to change the include
- and lib directories
- EXAMPLE.MAK Example make file for Microsoft
- EXAMPLES.CPP Another example application
- EXAMPLES.HPP Header for above
- EXAMPLES.PRJ Borland Project file for EXAMPLES.CPP
- EXAMPLES.MAK Microsoft make file for EXAMPLES.CPP
- BTUTOR.STD Short tutorial
- BTUTOR.HP2 BTUTOR.STD print file for HP2
- BTUTOR.HP3 BTUTOR.STD print file for HP3
- TUTOR.HPP Header file for tutorial
- TUTOR.CPP Tutorial source
- TUTOR.EXE Executable tutorial
- TUTOR.PRJ Project file for Borland
- TUTOR.MAK Makefile for Microsoft
-
-
-
- The Btrieve Class Library
-
- The shareware release should provide an application programmer with the full
- functionality of Btrieve 5.0. Please carefully examine the documentation,
- the tutorial, the class header files and the example programs, then try some
- short programs yourself.
-
-
- ------------------------------------
- CLASS DESCRIPTIONS & RELATIONSHIPS
- ------------------------------------
-
- This set of Btrieve classes was constructed as an OO 'wrapper' around the
- C interface provided with Btrieve. One problem with the standard interface
- is that it consists of one function call (BTRV) with various meanings at-
- tached to the parameters depending on the exact operation being performed.
- This is both difficult to learn and quite error prone.
-
- These classes have abstracted various roles from the many operations...roles
- like 'keyed access path'. Since these concepts are much closer to how one
- thinks about databases, a programmer is now freed from constantly translating
- her/his needs into one or more of the many op-codes. This makes the code much
- clearer and maintainable. An additional benefit for those not experienced
- with Btrieve is a much less forbidding learning curve.
-
- Much of this COULD be accomplished in C, but C++ offers inheritance so that
- the code is not just modular and reusable, but easily customized to a specific
- application's needs!
-
- Here are the classes with their associated filenames:
-
- BT_Def BTDEF.HPP
- BTDEF.CPP
-
- BT_KeyDef BTKDEF.HPP
- BTKDEF.CPP
-
- BT_SuppKeyDef BTSKDEF.HPP
- BTSKDEF.CPP
-
- BT_DataSet BTDSET.HPP
- BTDSET.CPP
-
- BT_Key BTKEY.HPP
- BTKEY.CPP
-
- BT_SuppKey BTSKEY.HPP
- BTSKEY.CPP
-
- BT_Manager BTMNGER.HPP
- BTMNGER.CPP
-
- BT_Transaction BTTRAN.HPP
- BTTRAN.CPP
-
-
-
- The classes fall into three groups: definition, access and miscellaneous.
-
- - Definition classes are used to create Btrieve files with
- their associated segmented keys.
-
- - Access classes are used to read, write, or update data.
-
- - Miscellaneous classes include a class to maintain data or key
- buffers. Also included is a class to provide functionality not
- included in either definition or access classes.
-
-
- ********************************
- ** Definition Classes: BT_Def **
- ********************************
-
- This is the class used to define a Btrieve database. Consult your Btrieve
- documentation for the usage of the various flags (which are all 'defined' in
- file BT.H). The normal sequence to define a file is:
-
- - declare an instance of BT_Def
-
- - add key segments (cf. Btrieve docs & BT.H)
-
- - set the alternate collating sequence (if any)
-
- - invoke the CreateBtrieve method with the file name and
- file creation mode
-
-
- Note: You MUST call AddFinalKeySegment to define the last segment of each
- key. If there is only one segment, use AddFinalKeySegment. Prior
- segments are defined using AddKeySegment.
-
- BT_Def will automatically calculate the pagesize. To override simply
- pass your own pagesize via the constructor.
-
- If you need to declare an alternate collating sequence, use either
- SetUpperAlt to use the standard case-insensitive collating sequence,
- or pass your custom collating sequence to SetAltCollSeq.
-
- The destructor will NOT create a database; CreateBtreive MUST be
- called to accomplish that. Check the returned value to verify
- file creation or to obtain the failure code.
-
-
-
- *********************************
- ** Definition Class: BT_KeyDef **
- *********************************
-
- This class is used internally to implement class BT_Def. Its duty is to
- record key information until BT_Def::CreateBtrieve is called.
-
-
- *************************************
- ** Definition Class: BT_SuppKeyDef **
- *************************************
-
- Use this class to define a supplemental key for an already existing database.
-
- - delcare an instance of BT_SuppKeyDef
-
- - invoke AddKeySegment/AddFinalKeySegment to define key segment(s)
-
- - invoke the appropriate BT_DataSet method to add the key
-
- Note: You should be familiar with key numbering problems associated with
- supplementary keys, especially in a network environment. Cf. BTDSET.HPP
- for more on this topic.
-
-
- ******************************
- ** Access Class: BT_DataSet **
- ******************************
-
- This class is used to gain access to a database; simply pass the Btrieve
- file name to the constructor along with the optional ownername and open-
- mode. Since constructors do not return results, use the Status function
- to verify success or return a Btrieve error code.
-
- Note that by itself this class provides only non-keyed access: the 'step'
- operations.
-
-
- **************************
- ** Access Class: BT_Key **
- **************************
-
- Use this class (obtained from a BT_DataSet) to access a key path. Use the
- SetKeyVal and GetKeyVal calls to (guess!) set the key (e.g., for GetEqual)
- or get the key returned from a call. The class also provides for the use
- of locks and key-only access.
-
-
- ******************************
- ** Access Class: BT_SuppKey **
- ******************************
-
- This provides all the functionality of BT_Key, but for a supplemental key.
- There is a method provided for dropping the supplemental key (DropKey).
-
-
- *****************************
- ** Misc. Class: BT_Manager **
- *****************************
-
- This class provides access to Btrieve operations which are not appropriate
- to the other classes. Simply instanciate and use.
-
-
- *********************************
- ** Misc. Class: BT_Transaction **
- *********************************
-
- Instanciate to begin a transaction. Commit must be called or the transaction
- will be aborted by the destructor.
-
-
- **************************
- ** Misc. Class: BT_Buff **
- **************************
-
- This class 'manages' the data and key buffers -- this is analogous to the
- function of many STRING classes. A BT_DataSet object has an internal BT_Buff.
- The user also has the option of declaring their own instance of a BT_Buff.
- BT_Key manages its own internal BT_Buff.
-
- Note that many 'internal' data members of this class are protected rather than
- private. This allows easy derivation of classes which are application specific.
- These classes would 'know' the details of the record layout.
-
- ---------------------- End of Class Descriptions -----------------------------
-
- The Tutorial Files
-
- We have written a short tutorial demonstrating one approach to using the
- Btrieve classes in an application (cf. BTUTOR.* and TUTOR.*). Perhaps
- it will be expecially useful to those who have minimal experience with
- object technology. Nevertheless, it's demonstrates only one approach;
- others may be equally useful.
-
-
- Using the Library
-
- Place all of the .HPP files, BT.H and the appropriate .LIB in your working
- directory (SBTBOR3.LIB with Borland 3 ... SBTMS7.LIB with Microsoft). Also
- place your copy of the Btrieve interface file in the working directory. In-
- clude the required class definitions in your source and compile using the
- SMALL memory model. Then link with the library. The example programs ran
- successfully when we started Btrieve with the following command line:
-
- btrieve /M:48 /P:4096 /E /T:c:\btrieve.trn
-
-
- Support for Btrieve 5.1 Extended Operations
- * Commercial Version *
-
- Object Resource's first commercial version of the Btrieve classes will be
- available shortly (in beta test as of Sep 92). The extended operations will
- be supported ONLY in the commercial version.
-
-
- Object Resource Corporation
-
- We are a company dedicated to providing object oriented software components
- to the developer community. We have been very pleased with response to this
- class library and will offer more in the future...although most will be
- via commercial channels.
-
- User Support
-
- We will extend our best efforts to assist you in using these class
- libraries. Support methods include:
-
- CompuServe: 72467,211
-
- Telephone: (214) 528-2745 (daytime only...leave message)
- We will return your call (COLLECT) as soon as possible.
-
- Uncle Sam Mail: Object Resource Corp.
- 4323 Brown, Suite 249
- Dallas, TX 75219
-
-
- THIS SOFTWARE IS SHAREWARE !!
-
- Shareware is freely distributable software. This allows potential users
- to evaluate whether it is a useful tool for their activities. It is also
- a way around wholesalers and retail outlets; this saves money for every-
- one.
-
- If you find this class library useful and continue to use it in either
- personal, in-house or commercial applications, you are morally bound to
- register as a user and pay the registration fee. (These classes may be
- used to save significant development time ... $55 is CHEAP!!) Don't be-
- come an instance of class FreeLoader!
-
-
- The shareware registration fee for this release is FIFTY-FIVE U.S. DOLLARS
- ($55). TEXAS RESIDENTS MUST ADD STATE SALES TAX. Registered users will
- receive FULL SOURCE CODE for the shareware library, additional DOCUMENTATION
- for class member functions and SUPPORT via CompuServe, US Mail or telephone
- (on your dime). Additionally, the shareware registration fee may be applied
- to the purchase of the commercial version. (Upon initial release of the
- commercial version, shareware registrants will receive an introductory up-
- grade offer.)
-
-
-
- OUTSIDE THE U.S.
-
- Registrants outside the United States must add THIRTY U.S. dollars ($30)
- to the registration fee for a total of EIGHTY-FIVE DOLLARS ($85). This
- will cover bank collection fees and shipping.
-
-
- ** Expidited Registration for CompuServe Users **
-
- If you need to register and receive the source ASAP, please:
-
- 1) Express mail (overnight) the registration form along with your check
- or money order to the provided address.
-
- (Please DO NOT use Federal Express. They do a fine job, but if no one
- is present when they attempt delivery, we must drive to a remote
- part of town to retrieve the package. The post office is just around
- the corner.)
-
- 2) Telephone us to expect the package (we have an answering machine).
-
- Upon receipt of the registration, we will email the necessary files
- to your CompuServe account.
-
- ----------------------------<Registration Form>--------------------------------
-
- ---------------------------------------------
- $55 ORG Btrieve Class Library User Registration Version 2.02
- ---------------------------------------------
- ** Shareware Version **
-
- (Please PRINT!)
-
- Date:
-
-
- Name:
-
-
- Address:
-
-
- City/St/Zip:
-
- (outside the United States...see note above)
-
-
- Area Code/Phone:
-
- Area Code/Fax:
-
- CompuServe ID (if any):
-
- Briefly, how do you plan to use this product?
-
-
-
-
- Circle the Btrieve environments that you use:
-
- DOS VAP NLM WINDOWS OTHER
-
- Which compilers do you use?
-
- BORLAND MICROSOFT OTHER:_______________
-
- Make check or money order payable to: OBJECT RESOURCE CORP.
-
- ...and send to: Object Resource Corp.
- 4323 Brown #249
- Dallas, TX 75219
-
- Please include your comments and suggestions!
-
- ------------------------------------------------------------------------------
-
- Thank you!
-
- Chuck McWilliam
- Object Resource Corp.
-